<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<meta name="description" content="传说中，在数千年前的古印地安人便常用一种由夜色供给世间的灵药，来解除人类的痛，这种灵药是来自一种只会在夜间开出美丽的黄花，但于日出月隐后便雕谢的植物种子提炼出的成分。这种植物因此被命名为月见草。" />
	<title>LIVING LIKE @ FLAG - 微观世界！</title>
	<link type="text/css" rel="stylesheet" href="<?php echo __PUBLIC__?>/style/basic.css" />
	<link type="text/css" rel="stylesheet" href="<?php echo __PUBLIC__?>/js/popupbox/jquery.popupbox.css" />
	<script type="text/javascript" src="<?php echo scURL('js/init')?>"></script>
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/js/jquery.js"></script>
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/js/popupbox/jquery.popupbox.js"></script>
	<style type="text/css">
		.content{padding:20px;}
	</style>
</head>
    
<body id="body">
	
	<div id="main">
	<div class="content">
		
		<form id="dataForm" accept-charset="utf-8" method="post">
			<p><input type="text" id="username" name="username" placeholder="用户名" />
			<p><input type="password" id="password" style="width:320px;" name="password" placeholder="密码" />
			<p>
			<input type="hidden" id="refer" name="refer" value="<?php echo $refer;?>" />
			<input type="submit" class="button" value="登录!" />
   		</form>
    
	</div>
	</div>
	
	<script type="text/javascript" src="<?php echo __PUBLIC__?>/js/navigation.js"></script>
	<script type="text/javascript">
	$(function() {
		$('#username').focus();
		$('#dataForm').submit(function() {
			
			if('' == $.trim($('#username').val())) {
				$('#username').focus();
				return false;
			}
			if('' == $.trim($('#password').val())) {
				$('#password').focus();
				return false;
			}
			
			$.post('<?php echo scURL('user/login')?>', $('#dataForm').serialize(), function(response) {
				if(Scabish.analyseResponse(response)) {
					window.location.href = $('#refer').val();
				} else {
					$.popupbox({
						message : '登录失败，请重试 :( ',
						time : 1
					});
				}
			});
			
			return false;
		});
	});
	</script>
</body>
</html>